package com.jluzh.server;

import com.jluzh.bean.Project;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

/**
 * @author EvanHuang
 * @date 11/5/2018 1:22 PM
 * @since
 */
@Path("provider")
public class ProviderResource {
    @GET
    @Path("{id}")
    @Produces(MediaType.APPLICATION_JSON)
    public Project get(@PathParam("id") Long id) {
        return new Project(id, "proj");
    }

    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Project save(Project p) {
        p.setId(100L);
        System.out.println("testPost");
        return p;
    }

}
